package com.dp.mallchat.common.user.service.adapter;

import com.dp.mallchat.common.user.domain.entity.UserApply;
import com.dp.mallchat.common.user.domain.user.resp.UserApplyPageResp;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @Author: dupeng
 * @CreateTime: 2024-06-19  19:57
 * @Description: 好用申请适配嘞
 */
public class UserApplyAdapter {


    public static List<UserApplyPageResp> buildUserApplyList(List<UserApply> records) {
        return records.stream().map(item -> {
            UserApplyPageResp userApplyPageResp = new UserApplyPageResp();
            userApplyPageResp.setApplyId(item.getId());
            userApplyPageResp.setTargetId(item.getTargetId());
            userApplyPageResp.setMsg(item.getMsg());
            userApplyPageResp.setType(item.getType());
            userApplyPageResp.setStatus(item.getStatus());
            return userApplyPageResp;
        }).collect(Collectors.toList());
    }
}
